<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
    <h:head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>MeteoCal</title>
        <link href="./../css/invite_users.css" rel="stylesheet" type="text/css" />
    </h:head>
    <h:body style="background-color:#81a4c7">
        <div id="central">
            <div id="profile_area">
                <div id="profile_container">
                    <div id="profile_header">
                        <h1>Search users to invite</h1>
                    </div>
                    <h:form id="form">      
                        <p:panel id="panel" header="Insert a keyword (name, surname, email or phone)" style="margin-bottom:10px;">
                        <p:messages id="messages" />

                        <h:panelGrid columns="4" cellpadding="5">
                            <h:outputLabel for="txt1" value="Keyword: *" />
                            <p:inputText id="txt1" value="#{searchBean.parameter}" required="true" label="Text 1">
                                <f:validateLength minimum="2" />
                            </p:inputText>
                            
                        </h:panelGrid>
                        </p:panel>

                        <h:panelGrid columns="1">
                            <p:commandButton process="@form:@child(1):txt1" update="@form" value="Search"/>
                        </h:panelGrid>
                        
                        <p:dataList value="#{searchBean.searchUsers(searchBean.parameter)}" var="user" type="unordered" itemType="none" paginator="true" rows="10" styleClass="paginated">
                            <f:facet name="header">
                                Result list (click to invite)
                            </f:facet>
                            <p:commandLink action="#{nb.inviteUser()}" title="Invite" styleClass="ui-icon ui-icon-plusthick" style="float:left;margin-right:10px"/>
                            <h:outputText value="#{user.name} #{user.surname}, #{user.email}" style="display:inline-block"/>
                        </p:dataList>
                    </h:form>
                </div>
            </div>
            <div id="menu">
                <br />
                <div>
                    
                </div>
            </div>
        </div>
         <div id="footer">
            <p>Software engineering 2</p>
            Project 2014-2015<br />
            Rimoldi_Lattari<br />
            <p></p>
        </div>
    </h:body>
</html>